interface CreateOrderAPIResData {
  code: number
  msg: string
  time: string
  data: string // 订单 id
}

export interface CreateOrderAPIData {
  type: string
  city: string
  start_place: string
  start_place_lat: string
  start_place_lng: string
  end_place: string
  end_place_lat: string
  end_place_lng: string
  coupon_id?: string | null
  num: string
  start_time: string
  passengers_mobile: string
  passengers_name: string
  pronoun_name?: string
  pronoun_mobile?: string
  priority_contact?: string
  remark?: string
  goods_type?: string
  images?: string
}

export function createOrderAPI(data: CreateOrderAPIData, token: string) {
  return httpInstance.post<CreateOrderAPIResData, CreateOrderAPIData>(
    '/api/order/createorder',
    data,
    { headers: { token } },
  )
}
